﻿import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
Item
{
    id:root001
    width: bgMenu.width
    height: bgMenu.height
    // 单个菜单项总宽度
    property int menuItemWidth: 150
    // 单个菜单项总高度
    property int menuItemHeight: 50 * root.y_enl
    // 子菜单与菜单项的上边距
    property int subMenuTopMargin: 12
    property int subMenuRadius: 3
    property int subMenuItemWidth: 120

    // 菜单背景
    Rectangle
    {
        id:bgMenu
        width: menuList.width
        height:menuList.height
        color: "#CC393E39"
        radius: 3
        Row{
            id: menuList
            width: root001.menuItemWidth * 4
            height: root001.menuItemHeight
//            transform: Scale { origin.x: 0; origin.y: 0; xScale: 1.5;yScale: 1.5}
            //态势感知
            APPFirstMenu{
                menuText: "三维分析"
                icoSource:"./切图/菜单图标/图标白/态势感知.png"
                transform: Scale { origin.x: 0; origin.y: 0; xScale: root.x_enl;yScale: root.y_enl}
                //子菜单
                Item{
                    id: visualizationSubMenu
                    width: root001.subMenuItemWidth
                    anchors.top: parent.bottom
                    anchors.topMargin: root001.subMenuTopMargin
                    visible: false
                    Column{
                        width: visualization2D.width
                        APPSecondMenu{
                            id: vectorWind
                            secondMenuText: "网络资源"
                            mouseclick: function(){
                                //mainApp.slotShowWebViewUrl("/xeye/cybermap/3Delements.html");
                                app.slotShowLandmarks();
                            }
                        }


                        APPSecondMenu{
                            id: fogAnalysis
                            secondMenuText: "网络拓扑"
                            mouseclick: function(){
                                app.slotShowNightBuildings();
                            }
                        }

                        APPSecondMenu{
                            id: satellite
                            secondMenuText: "网络攻击图"
                            mouseclick: function(){
                                app.slotShowCyberThreat();
                                cyberThreatWidget.visible = !cyberThreatWidget.visible;
                            }
                        }


                        /*APPThirdMenu{
                            id: heatupGraph3D
                            thirdMenuText: "三维热力图"
                            mouseclick: function(){
                                app.slotShowHotMap3d();
                            }
                        }*/
                    }
                }

                MouseArea{
                    anchors.fill: parent
                    onClicked:{
                        closeAllSubMenu()
                        showVisualizationSubMenu()
                    }
                }

            }

            // 数据图层
            APPFirstMenu{
                menuText: "二维分析"
                icoSource:"./切图/菜单图标/图标白/数据图层.png"
                transform: Scale { origin.x: 0; origin.y: 0; xScale: root.x_enl;yScale: root.y_enl}
                //子菜单
                Item{
                    id: layerProtectionSubMenu
                    width: root001.subMenuItemWidth
                    anchors.top: parent.bottom
                    anchors.topMargin: root001.subMenuTopMargin
                    visible: false
                    Column{
                        APPSecondMenu{
                            id: zonghetaishi
                            secondMenuText: "二维分析"
                            mouseclick: function(){
                                mainApp.slotShowWebViewUrl("/xeye/cybermap/Abstract.html");
                            }
                        }
                    }
                }

                MouseArea{
                    anchors.fill: parent
                    onClicked:{
//                        app.slotOpenOutputWebPage();
//                        closeAllSubMenu()
                        closeAllSubMenu()
                        showNayerProtectionSubMenu()

                    }
                }
            }
            // 综合数据管理
            APPFirstMenu{
                menuText: "数据管理"
                icoSource:"./切图/菜单图标/图标白/污染企业.png"
                transform: Scale { origin.x: 0; origin.y: 0; xScale: root.x_enl;yScale: root.y_enl}
                //数据同化子菜单
                Item{
                    id: dataProcessSubMenu
                    width: root001.subMenuItemWidth
                    anchors.top: parent.bottom
                    anchors.topMargin: root001.subMenuTopMargin
                    visible: false
                    Column{
                        APPSecondMenu{
                            secondMenuText: "数据库管理"
                            mouseclick: function(){
                                mainApp.slotShowDatabaseView();
                            }
                        }

                    }
                }
                MouseArea{
                    anchors.fill: parent
                    onClicked:{
                        closeAllSubMenu()
                        showDataProcessSubMenu()
                    }
                }
            }
            // 工具箱
            APPFirstMenu{
                menuText: "工具箱"
                icoSource:"./切图/菜单图标/图标白/工具箱.png"
                transform: Scale { origin.x: 0; origin.y: 0; xScale: root.x_enl;yScale: root.y_enl}
                // 工具箱子菜单
                Item{
                    id: toolBoxSubMenu
                    width: root001.subMenuItemWidth
                    anchors.top: parent.bottom
                    anchors.topMargin: root001.subMenuTopMargin
                    visible: false
                    Column{
                        APPSecondMenu{
                            secondMenuText: "面积量测"
                            mouseclick: function(){
                                earthView.slotMeasure(2)
                                sysDistMeasure.visible = false;
                                sysAreaMeasurement.visible = true;
                            }
                        }
                        APPSecondMenu{
                            secondMenuText: "距离量测"
                            mouseclick: function(){
                                earthView.slotMeasure(1)
                                sysDistMeasure.visible = true;
                                sysAreaMeasurement.visible = false;
                            }
                        }

                        APPSecondMenu{
                            secondMenuText: "插值分析"
                            mouseclick: function(){
                                sysDataRefineControler.visible = true;
                            }
                        }
                        APPSecondMenu{
                            secondMenuText: "图像导出"
                            mouseclick: function(){
                                app.slotOutputImage();
                            }
                        }
                        APPSecondMenu{
                            secondMenuText: "录像输出"
                            mouseclick: function(){
                                app.slotVedio()
                            }
                        }
                    }
                }
                MouseArea{
                    anchors.fill: parent
                    onClicked:{
                        closeAllSubMenu()
                        showToolBoxSubMenu()
                    }
                }
            }



        }
    }

    function closeSubMenu()
    {

    }

    function closeAllSubMenu(){
        visualizationSubMenu.visible = false
        //visualizationInferSubMenu2.visible = false
        //naturalProtectionSubMenu.visible = false
        //visualizationInferSubMenu.visible = false
        dataProcessSubMenu.visible = false
        toolBoxSubMenu.visible = false
        layerProtectionSubMenu.visible = false
        //listItem.visible = false
    }

    function showVisualizationSubMenu(){
        visualizationSubMenu.visible = true
    }
    function showNaturalProtectionSubMenu(){
        naturalProtectionSubMenu.visible = true
    }
    function showVisualizationInferSubMenu(){
        visualizationInferSubMenu.visible = true
    }
    function showDataProcessSubMenu(){
        dataProcessSubMenu.visible = true
    }
    function showToolBoxSubMenu(){
        toolBoxSubMenu.visible = true
    }

    function showNayerProtectionSubMenu()
    {
        layerProtectionSubMenu.visible = true
    }

}
